// 引入
import requests from './request'
const baseUrl = 'http://localhost:8888/chuyangc'
//api列表

//用户api
//遍历用户数据
export const listAdmin = () => {
  return requests({
    url: baseUrl + '/admin/listadmin',
    method: 'GET'
  })
};

//删除用户数据
export const delAdmin = (id) => {
  return requests({
    url: baseUrl + '/admin/deladmin/' + id,
    method: 'DELETE'
  })
};

//添加用户信息
export const addAdmin = (Admin) => {
  return requests({
    data: Admin,
    url: baseUrl + '/admin/addadmin',
    method: 'POST'
  })
};

//根据id查找用户信息
export const searchAdmin = (id) => {
  return requests({
    url: baseUrl + '/admin/searchadmin/' + id,
    method: 'GET'
  })
};

//根据id更新用户信息
export const updateAdmin = (Admin) => {
  return requests({
    data: Admin,
    url: baseUrl + '/admin/updateadmin',
    method: 'POST'
  })
};

//茶友api
//遍历茶友数据
export const listTeafriend = () => {
  return requests({
    url: baseUrl + '/teafriend/listtf',
    method: 'GET'
  })
};

//删除茶友数据
export const delTeafriend = (id) => {
  return requests({
    url: baseUrl + '/teafriend/deltf/' + id,
    method: 'DELETE'
  })
};

//添加茶友信息
export const addTeafriend = (Teafriend) => {
  return requests({
    data: Teafriend,
    url: baseUrl + '/teafriend/addtf',
    method: 'POST'
  })
};

//根据id查找茶友信息
export const searchTeafriend = (id) => {
  return requests({
    url: baseUrl + '/teafriend/searchtf/' + id,
    method: 'GET'
  })
};

//根据id更新茶友信息
export const updateTeafriend = (Teafriend) => {
  return requests({
    data: Teafriend,
    url: baseUrl + '/teafriend/updatetf',
    method: 'POST'
  })
};

//茶叶api
//遍历茶叶数据
export const listTea = () => {
  return requests({
    url: baseUrl + '/tea/listtea',
    method: 'GET'
  })
};

//删除茶叶数据
export const delTea = (id) => {
  return requests({
    url: baseUrl + '/tea/deltea/' + id,
    method: 'DELETE'
  })
};

//添加茶叶信息
export const addTea = (Tea) => {
  return requests({
    data: Tea,
    url: baseUrl + '/tea/addtea',
    method: 'POST'
  })
};

//根据id查找茶叶信息
export const searchTea = (id) => {
  return requests({
    url: baseUrl + '/tea/searchtea/' + id,
    method: 'GET'
  })
};

//根据id更新茶叶信息
export const updateTea = (Tea) => {
  return requests({
    data: Tea,
    url: baseUrl + '/tea/updatetea',
    method: 'POST'
  })
};

//订单api
//遍历订单数据
export const listGoods = () => {
  return requests({
    url: baseUrl + '/goods/listgoods',
    method: 'GET'
  })
};

//删除订单数据
export const delGoods = (id) => {
  return requests({
    url: baseUrl + '/goods/delgoods/' + id,
    method: 'DELETE'
  })
};

//添加订单信息
export const addGoods = (Good) => {
  return requests({
    data: Good,
    url: baseUrl + '/goods/addgoods',
    method: 'POST'
  })
};

//根据id查找订单信息
export const searchGoods = (id) => {
  return requests({
    url: baseUrl + '/goods/searchgoods/' + id,
    method: 'GET'
  })
};

//根据id更新订单信息
export const updateGoods = (Good) => {
  return requests({
    data: Good,
    url: baseUrl + '/goods/updategoods',
    method: 'POST'
  })
};